package com.ctshk.sapp.order.goods.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.order.goods.dto.CommoditySpecialDTO;
import com.ctshk.rpc.order.goods.req.ShoppingSpecialImportReq;
import com.ctshk.rpc.order.goods.service.IShoppingSpecialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *     商品专题
 * </p>
 *
 * @author 黄利斌
 * @date 2021/6/24 6:07 下午
 */
@Api(value="商品专题", tags="商品专题")
@RestController
@RequestMapping("/special")
public class OrderShoppingSpecial extends BaseController {

    @DubboReference
    private IShoppingSpecialService shoppingSpecialService;

    @ApiOperation(value = "B端-商品-专题管理-导入商品", notes = "B端-商品-专题管理-导入商品")
    @OperationLogAnnotation(operModul = OperationLogModel.ORDER, operType = OperationLogType.QUERY, operTitle = "B端-商品-专题管理-导入商品", operDesc = "B端-商品-专题管理-导入商品")
    @PostMapping("/importCommodity")
    public Result<PageResponse<CommoditySpecialDTO>> importCommodity(@RequestBody ShoppingSpecialImportReq req) {
        return shoppingSpecialService.importCommodity(req);
    }

}
